These X-commands were used in the preparation of this stack, and are part of the ShowDialog "package."
-- part contents for background part 15
----- text -----
SplashDialog XCMD 1.0
Copyright© 1989 by Jay Hodgdon
SplashDialog makes for a simple "About..." dialog that can be shown at stack "launch" time. It displays a
"timed" dialog containing a graphic that dismisses itself after a specified period of time.
• Click here for a demo •
If you desire, the dialog may be preceeded by and followed by a zooming effect. The dialog will appear to zoom in from the top, left corner of the Macintosh screen. The effect begins at the edge of the SCREEN, NOT the card window. The effect even works when your color monitor is set for color!
<DLOG ID> is the resource ID of the dialog to display;
<time delay> is the length of time in seconds that the splash screen is displayed;
<zoom BOOLEAN> is TRUE for zooming or FALSE for no zooming;
The last two parameters are OPTIONAL. If they are omitted, the dialog is centered within the card window.
If the specified DLOG resource is missing, or an incorrect number of parameters is passed, the dialog exits with a beep.
Constructing a SplashDialog DLOG/DITL template:
The SplashDialog template can contain any number of PICT and Static Text DITL items. They should all be DISABLED because no interaction takes place between the dialog and the user.
-- part contents for background part 17
----- text -----
CreditsDialog XCMD 1.11
Copyright© 1988, 1989 by Jay Hodgdon
CreditsDialog displays a dialog that contains two different PICTs. When the dialog is clicked on, the first PICT is swapped out for the second. When the dialog is clicked again, it is dismissed. (Hitting enter or return is the same as clicking the mouse on the dialog.) The dialog zooms in from the top, left corner of the Macintosh screen (NOT the card window). This makes for a handy "About..." dialog.
• Click here for a demo •
Its parameters are:
CreditsDialog <DLOG ID>,<1st PICT ID#>,
<2nd PICT ID#>[,<top coord>,<left coord>]
where
<DLOG ID> is the resource ID of the dialog to display;
<1st PICT ID#> is the resource ID of the first PICT that is displayed;
<2nd PICT ID#> is the resource ID of the second PICT that is displayed;
The last two parameter are OPTIONAL. If they are omitted, the dialog is centered within the card window.
If the specified DLOG resource is missing, or an incorrect number of parameters is passed, the dialog exits with a beep.
If the specified PICTs are missing, the XCMD beeps and displays an empty dialog.
Constructing a CreditsDialog DLOG/DITL template:
A CreditsDialog template should contain at least two DITL items:
DITL item#1 is an ENABLED useritem that should cover the ENTIRE area of the dialog window. It is a mouse click on this item that will swap the PICTs (and dismiss the dialog).
DITL item#2 is a DISABLED useritem into which the PICTs will be drawn. This item, naturally, will overlap with DITL item#1. The rect of this item must be large enough to contain the PICT. Otherwise the PICT will be squished down to fit into it (this is unsightly!). The PICT will be centered within this item.
If you want to get tricky, the dialog can contain other DITL items (other PICTs or text) that will remain
"static" as the other PICTs are swapped. These other DITL items must not overlap with DITL item#2
(because the rect of DITL item#2 is cleared before the PICTs are swapped).
Revision history:
1.0 11/11/88
initial release.
1.1 12/18/88
added "zooming" before and after dialog is displayed.
1.11 12/23/88
eliminated white spot left behind when the dialog is dismissed (prior to "zoom out").
-- part contents for background part 31
----- text -----
To be announced...
-- part contents for background part 18
----- text -----
TextDialog XCMD 1.3
©Copyright 1988, 1989 by Jay Hodgdon
This version is not the one that will be in the "release" ShowDialog 1.6 stack. This version does not support mixed-style text.
• Click here for a demo •
TextDialog XCMD displays a dialog that can show up to 255 scrolling text screens, each containing up to 32K of text. A TextDialog dialog is "semi-modal." It can have a titlebar that allows it to be dragged around the screen, but it must be dismissed before other actions can be taken.
Scrolling of the TextDialog field is under full keyboard control:
ΓÇó Pressing the Home or End keys on the extended keyboard will scroll the field either to the top or bottom.
ΓÇó Pressing the arrow up or arrow down keys will scroll the field one line at a time. Pressing these same keys with the command key held down will scroll the field an entire page.
ΓÇó Pressing the page up or page down keys will scroll the screen an entire page.
ΓÇó Pressing the arrow left or arrow right keys will cycle text screens in the same mannor as pressing the Prev or Next buttons.
ΓÇó Pressing enter or return or clicking the goAway box on the titlebar cancels the dialog.
<font> is the font name that the text will appear in;
<pt. size> is the point size that the text will appear in;
<TEXT screens> is a comma-delimited list of the TEXT resource ID's that will be shown in the dialog;
<1st screen> is the item number from the <TEXT screens> list specifying which screen will be shown when the dialog is initially displayed.
The last two parameters are OPTIONAL. If they are omitted, the dialog will be centered within the card window.
If you request a point size less than 7, you will get 9 pt. as default (point sizes less than 7 can't be read on a Macintosh screen!). If you specify a point size that is larger than 24 pt. you'll get 9 pt. instead. If you specify a font name that isn't available, you'll get Chicago 12 pt. by default.
Constructing a TextDialog DLOG/DITL template:
If you wish your TextDialog dialog to be "draggable," assign the DLOG template a procID of 0, which will give it a menubar. It CAN have a goAway box in the titlebar, if you desire.
DITL item# 1: an ENABLED button (the Cancel button)
DITL item#2: a DISABLED useritem (the rect that the text will be displayed in)
DITL item#3: an ENABLED button (the PREV button)
DITL item#4: an ENABLED button (the NEXT button)
When placing DITL item #2 (which will be the rect of the display text field) remember to leave a 17 pixel-wide space to the RIGHT that will be occupied by the scroll bar.
For aesthetic reasons (so that you will never see the bottom line of text in the display text field cut off), TextDialog first computes how many lines of text can fit in the display rectangle, given the font and size that you specify, and resizes the bottom of DITL item #2 so that its length is an exact multiple of the line height of the text. Because of this, you may notice that the outline of the display rectangle doesn't EXACTLY match DITL #2 (it may be a bit longer or shorter).
TextDialog uses TEXT resources for the contents of the text screens. The TEXT resources are created with ResEdit. To make a TEXT resource, write your text with your favorite word processor. Copy it to the clipboard. Open the stack with ResEdit. Create a new TEXT resource and copy the text in. Make a note of the resource ID for the <TEXT screens> parameter.
Remaining DITL items can be Static Text, icons, or PICTs.
Revision history:
1.0 11/16/88: obtains data for the text screens from HyperCard fields or HyperTalk variables.
1.1 11/17/88: added parameter to choose which screen is initially displayed.
1.2 11/20/88: switched to using TEXT resources for the contents of the screens.
1.22 3/3/89: added parameters for specification of font and point size.
1.3 5/3/89: made dialog "semi-modal" and the text field scrollable.